package top.ffhome.common.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 模型的基础类<br/>
 * 实现了主键及重写了通用方法
 */
@ToString
public class IdEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/** 主键 */
	@ApiModelProperty(value = "主键")
	@Getter
	@Setter
	private Long id;

	/** 请求参数 */
	@Setter
	@JsonIgnore
	private Map<String, Object> params;

	public Map<String, Object> getParams() {
		if (params == null) {
			params = new HashMap<>();
		}
		return params;
	}
}
